package com.tool;
public class Message {
    private static final String[] ROLE = {"assistant", "user", "system"};
    private String content;
    private String role; // 添加角色字段以匹配JSON结构

    public Message() {}

    public Message(String content) {
        this.content = content;
        this.role = ROLE[1]; // 默认为用户消息
    }

    public Message(Integer role, String content) {
        this.role = ROLE[role];
        this.content = content;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getRole() {
        return role;
    }
    public static Message add(Integer role,String content) {
        return new Message(role,content);
    }
}
